<?php
class AdminModel extends Model {
  //自动完成
  protected $_auto = array (
    array('admin_created', 'getTime',1,'callback'),
    array('admin_createdby', 'getName',1,'callback'),
    array('admin_updated','getTime',3,'callback'),
    array('admin_updatedby','getName',3,'callback')
  );

  public function getName() {
    return $_SESSION['trackUser']['admin_id'];
  }

  public function getTime() {
    return time();
  }

  //自动验证
  protected $_validate = array(
    array('admin_username','require','用户名必须填写'),
    array('admin_username','','用户名已存在',0,'unique',3)
  );
}
